Several alternative "freezing" modules exists, see https://wiki.python.org/moin/DistributionUtilities
cx_Freeze is considered a good option as it is cross platform and supports python 2 and 3.
Creating simple standalone applications is a three step process
In [9]:
%%file "my_program.py"
from __future__ import division, print_function, absolute_import, unicode_literals
import time
import sys
import traceback
try: range = xrange; xrange = None
except NameError: pass
try: str = unicode; unicode = None
except NameError: pass
import numpy
while 1:
input = raw_input(">>")
if input == "quit()": break
try:
_return = None
try:
exec("_return = %s"%input, globals(), locals())
print (_return)
except SyntaxError:
exec(input, globals(), locals())
except Exception as e:
print (str(e))
print (traceback.format_exc())
In [24]:
%%file "setup.py"
from cx_Freeze import setup, Executable
setup(
name = "my_program",
version="1.0.0",
executables = [Executable("my_program.py")])
In [22]:
import os
print (os.system("python setup.py build"))
Now the application is build. You can find it in "./build/exe.../my_program.exe
In [ ]: